package top.hzy520.user.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.hzy520.common.DataSource;
import top.hzy520.common.DataSourceType;
import top.hzy520.user.dao.UserMapper;
import top.hzy520.user.entity.User;

/**
 * @Author: HouZeYu
 * @Description:
 * @Date: Created in 14:39 2018/8/15
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;


    @DataSource(DataSourceType.SLAVE)
    @Override
    public User findUserById(long id) {
     User user=userMapper.selectByPrimaryKey(id);
        return user;
    }
}
